/*
 * @Description: 
 * @Version: 
 * @Author: 学渣小宝
 * @Date: 2021-03-31 07:19:28
 * @LastEditors: 学渣小宝
 * @LastEditTime: 2021-03-31 21:24:16
 */

'use strict';

const { Service } = require('egg');

class githubService extends Service {
  async getFollowers(user_name, page, per_page) {
    const params = {
      page,
      per_page,
    };

    const service_api = `https://api.github.com/users/${user_name}/followers`;

    const res = await this.ctx.curl(service_api, { method: 'GET', data: params, dataType: 'json' });
    return res.data;
  }
}

module.exports = githubService;
